<template>
    <div class="app-banner">
        <div class="banner" />
        <div class="data">
            <div class="avatar">
                <img src="@img/avatar.webp" alt="悠悠博客">
            </div>
            <div class="count">
                <div class="item">
                    <div class="title">动态数量</div>
                    <span>{{ count.articles }}</span>
                </div>
                <div class="item">
                    <div class="title">闲言杂语</div>
                    <span>{{ count.comments }}</span>
                </div>
                <div class="item">
                    <div class="title">运行天数</div>
                    <span>{{ count.station }}</span>
                </div>
                <div class="item">
                    <div class="title">访客量</div>
                    <span>{{ view }}</span>
                </div>
            </div>
        </div>
    </div>
</template>
<script setup lang="ts">
import './app.less'

/**
 * 网站统计信息
 */
const { data: i } = await viewCountsApi()
const count = computed(() => i.value?.data ?? {} as ViewVo)
/**
 * 获取访问量
 */
const { data: l } = await viewApi()
const view = computed(() => l.value?.data.count ?? 0)
</script>